//服务端  管理员删除历史记录表
#include "staff.h"  
int process_client_delhistory_request(int newfd,Msg *msg)
{
	printf("------------%s-----------%d.\n",__func__,__LINE__);
	char sql[DATALEN] = {0};
	char *errmsg;
	char **result;
	int row,colum;
	sprintf(sql,"select *from historyinfo");
	if(sqlite3_get_table(db,sql,&result,&row,&colum,&errmsg) != SQLITE_OK){
		printf("---****----%s.\n",errmsg);
		return -1;
	}else{
		char buf[120] = "";
		if(row > 0){
			printf("==========================================\n");
			sprintf(buf,"delete from historyinfo ");
			sqlite3_get_table(db,buf,&result,&row,&colum,&errmsg);
			strcpy(msg->recvmsg,"删除记录成功");
			send(newfd,msg,sizeof(Msg),0);
		}
		strcpy(msg->recvmsg,"没有记录可删除");
		send(newfd,msg,sizeof(Msg),0);
	}
	return 0;
}
